from abc import abstractmethod
from wwengine.utils import Priority


class TransfromBase(object):
    def __init__(self, task, priority: Priority):
        self.tasks = task  # 当前aug支持的任务
        self.priority = priority  # 当前aug的优先级

    @abstractmethod
    def forward(self, data_dict):
        """数据增强"""
        pass

    def __call__(self, data_dict):
        return self.forward(data_dict)

    # 重写print
    def __str__(self):
        pass

    # 重写 < 符号用于sorted
    def __lt__(self, other):
        return self.priority < other.priority
